Skip to content

Conversation

@denar50
Copy link
Contributor

@denar50 denar50 commented Nov 19, 2025

Summary

Issue: https://github.com/elastic/security-team/issues/14504

A previous PR introduced the EASE Value report and the ability to export it in serverless. This PR makes the report available in ESS and adds logic to export it using the share plugin. The ESS export logic is different from that of serverless because schedule reporting is not available in Serverless yet (ResponseOps plans to add support for it in 9.4).

The reporting is initiated in the client's browser when the user clicks on the "Export report" button, which becomes available once the report data and the cost savings trend insight have been fetched and generated respectively.
The export report button makes a call to the server to generate a PDF for the report and passes the insight and a hash of the report data as parameters (aka "forwarded state").

A headless browser is used to navigate to a special route /app/reportingRedirect that looks up a the corresponding locator locator (in this case, AIValueReportLocatorDefinition) which in turns resolves the URL of the value report (/app/security/reports/ai_value) and the forwarded state to be stored in history.location.state.

The value report page reacts to this state being present and renders itself in "export mode". When the components finish loading, the headless browser takes screenshots of everything that is contained within the value report page, which has a data-shared-items-container attribute attached to it.

Notice that we only forward the insight and the hash of the report data in order to avoid calling an LLM again in the headless browser when the data itself hasn't changed.

image

How to test

  1. Run ESS locally (Elasticsearch and Kibana). Then log in as an admin and navigate to the rules management page (app/security/rules/management) to ensure that all indexes are properly initialized.
  2. Use the Security documents generator (fork) to generate 60 days of alert data. By running: yarn start generate-alerts -n 10000 -h 100 -u 100 --start-date 60d --end-date now
  3. Run Attack Discovery over the 60 days of data that you generated (see the video below)
Screen.Recording.2025-11-19.at.15.08.37.mov
  1. Navigate to the "Value report" page. You can use the link on the left side, or you can go to /app/security/reports/ai_value.

  2. Once the report loads, the "Export report" button should be enabled. Click on it and export it to a PDF. You should see a toast indicating that the export in ongoing and when it is done you should get a toast with a "Download report" button. Click on "Download report" and verify that the downloaded PDF matches the data that you are seeing on the screen.
    Play with it by adjusting the time window in the date picker next to the Export report button.

Screen.Recording.2025-11-19.at.15.15.093.mov

Known issues

  1. The icons next to these headings are clearer in the PDF and therefore hard to see
    PDF
image

Website
image

Pending

  1. Copy adjustments to the value report button
  2. Placement of the value report button in the launchpad
  3. Update the documentation on the restricted access view. See Documents new RBAC for value reports docs-content#3817
  4. Follow the instructions after updating the Elastic Assistant prompt.

@denar50 denar50 changed the title Enable value reports in ech with only ai generated data forwarded [Security Solution] Enable value reports in ESS Nov 19, 2025
@denar50 denar50 self-assigned this Nov 19, 2025
@denar50 denar50 force-pushed the enable-value-reports-in-ech-with-only-ai-generated-data-forwarded branch from 0ce5399 to bda9c51 Compare November 19, 2025 15:10
@denar50 denar50 force-pushed the enable-value-reports-in-ech-with-only-ai-generated-data-forwarded branch from 5a798ee to daacc5d Compare November 19, 2025 15:41
@denar50 denar50 changed the title [Security Solution] Enable value reports in ESS [Security Solution] Enable EASE Value reports in ESS Nov 19, 2025
@denar50 denar50 added the backport:skip This PR does not require backporting label Nov 19, 2025
@denar50 denar50 marked this pull request as ready for review November 21, 2025 15:09
@denar50 denar50 requested review from a team as code owners November 21, 2025 15:09
@denar50 denar50 added the release_note:feature Makes this part of the condensed release notes label Nov 21, 2025
@denar50
Copy link
Contributor Author

denar50 commented Nov 25, 2025

@stephmilovic I have added support for scheduling the report as well as some telemetry around the export report logic.

Copy link
Contributor

@akowalska622 akowalska622 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data Discovery changes code only review

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vis code changes 👍🏼

@denar50 denar50 added the ci:cloud-deploy Create or update a Cloud deployment label Nov 26, 2025
@denar50 denar50 requested a review from stephmilovic November 26, 2025 14:54
@denar50 denar50 requested a review from vitaliidm November 27, 2025 13:50
@kibanamachine
Copy link
Contributor

🤖 Prompt Changes Detected

Changes have been detected to one or more prompt files in the Elastic Assistant plugin.

Please remember to update the integrations repository with your prompt changes to ensure consistency across all deployments.

Next Steps:

  1. Follow the documentation in x-pack/solutions/security/packages/security-ai-prompts/README.md to update the corresponding prompt files
  2. Make the changes in the integrations repository
  3. Test your changes in the integrations environment
  4. Ensure prompt consistency across all deployments

This is an automated reminder to help maintain prompt consistency across repositories.

@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 28, 2025

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 8436 8443 +7

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/deeplinks-analytics 11 12 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 2.1MB 2.1MB +26.0B
securitySolution 11.1MB 11.1MB -58.6KB
total -58.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
reporting 41.4KB 41.5KB +60.0B
securitySolution 106.9KB 166.5KB +59.6KB
total +59.7KB
Unknown metric groups

API count

id before after diff
@kbn/deeplinks-analytics 11 12 +1

ESLint disabled line counts

id before after diff
securitySolution 698 697 -1

Total ESLint disabled count

id before after diff
securitySolution 805 804 -1

History

cc @denar50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:cloud-deploy Create or update a Cloud deployment release_note:feature Makes this part of the condensed release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants